const Mock = require('mockjs')

const tokens = {
  admin: {
    token: 'admin-token'
  },
  editor: {
    token: 'editor-token'
  }
}

const data = Mock.mock({
  'data|30': [{
    'id': '@id',
    'name': '@cname',
    'phone': /^1(5|3|7|8)[0-9]{9}$/,
    'city': '@county(true)',
    'createTime': '@datetime',
    'updateTime': '@datetime'
  }]
})

module.exports = [
  // import list
  {
    url: '/vue-admin-template/customer/dashboard',
    type: 'get',
    response: config => {
      return {
        code: 20000,
        data: data
      }
    }
  },
  //
  {
    url: '/vue-admin-template/customer/get',
    type: 'get',
    response: config => {
      return {
        code: 20000,
        data: data
      }
    }
  },
  {
    url: '/vue-admin-template/customer/tt',
    type: 'get',
    response: config => {
      return {
        code: 20000,
        data: [{ id: '001' }, { id: '002' }, { id: '003' }, { id: '004' }, { id: '005' },]
      }
    }
  },
]